package entity;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;

/**
 * TypeBillet entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "type_billet", schema = "public")
public class TypeBillet implements java.io.Serializable {

	// Fields

	private Integer id;
	private Evenement evenement;
	private double prix;
	private Integer quantite;
	private String modele;
	private String typeCarte;
	private Set<Typeb> typebs = new HashSet<Typeb>(0);

	// Constructors

	/** default constructor */
	public TypeBillet() {
	}

	/** full constructor */
	public TypeBillet(Evenement evenement, double prix, Integer quantite,
			String modele, String typeCarte, Set<Typeb> typebs) {
		this.evenement = evenement;
		this.prix = prix;
		this.quantite = quantite;
		this.modele = modele;
		this.typeCarte = typeCarte;
		this.typebs = typebs;
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "increment")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "id_evenement")
	public Evenement getEvenement() {
		return this.evenement;
	}

	public void setEvenement(Evenement evenement) {
		this.evenement = evenement;
	}

	@Column(name = "prix", precision = 17, scale = 17)
	public double getPrix() {
		return this.prix;
	}

	public void setPrix(double prix) {
		this.prix = prix;
	}

	@Column(name = "quantite")
	public Integer getQuantite() {
		return this.quantite;
	}

	public void setQuantite(Integer quantite) {
		this.quantite = quantite;
	}

	@Column(name = "modele")
	public String getModele() {
		return this.modele;
	}

	public void setModele(String modele) {
		this.modele = modele;
	}

	@Column(name = "type_carte")
	public String getTypeCarte() {
		return this.typeCarte;
	}

	public void setTypeCarte(String typeCarte) {
		this.typeCarte = typeCarte;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "typeBillet")
	public Set<Typeb> getTypebs() {
		return this.typebs;
	}

	public void setTypebs(Set<Typeb> typebs) {
		this.typebs = typebs;
	}

}